import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '提交人',
    align:"center",
    dataIndex: 'createBy'
   },
   {
    title: '提交时间',
    align:"center",
    dataIndex: 'createTime'
   },
   {
    title: '赛事',
    align:"center",
    dataIndex: 'sais_dictText'
   },
   {
    title: '赛区',
    align:"center",
    dataIndex: 'saiq',
    customRender:({text}) => {
       return  render.renderCategoryTree(text,'C05')
   },
   },
   {
    title: '作品标题',
    align:"center",
    dataIndex: 'zuopbt'
   },
   {
    title: '作品id',
    align:"center",
    dataIndex: 'zuopId'
   },
   {
    title: '赛事进程',
    align:"center",
    dataIndex: 'saisjc_dictText'
   },
   {
    title: '评审状态',
    align:"center",
    dataIndex: 'pingszt_dictText'
   },
   {
    title: '资料审核结果',
    align:"center",
    dataIndex: 'zilshjg_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "赛事",
      field: 'sais',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"cdba2_sais,mingc,id"
      },
      //colProps: {span: 6},
 	},
	{
      label: "赛区",
      field: 'saiq',
      component: 'JCategorySelect',
      componentProps:{
          pcode:"C05",//back和事件未添加，暂时有问题
      },
      //colProps: {span: 6},
 	},
	{
      label: "作品标题",
      field: 'zuopbt',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "赛事进程",
      field: 'saisjc',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"cdba2_saisjc,jincmc,id"
      },
      //colProps: {span: 6},
 	},
	{
      label: "评审状态",
      field: 'pingszt',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"pingszt"
      },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '赛事',
    field: 'sais',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"cdba2_sais,mingc,id"
     },
  },
  {
    label: '赛区',
    field: 'saiq',
    component: 'JCategorySelect',
    componentProps:{
       pcode:"C05", //TODO back和事件未添加，暂时有问题
    },
  },
  {
    label: '作品标题',
    field: 'zuopbt',
    component: 'Input',
  },
  {
    label: '作品id',
    field: 'zuopId',
    component: 'Input',
  },
  {
    label: '赛事进程',
    field: 'saisjc',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"cdba2_saisjc,jincmc,id"
     },
  },
  {
    label: '评审状态',
    field: 'pingszt',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"pingszt"
     },
  },
  {
    label: '资料审核结果',
    field: 'zilshjg',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"zilsh"
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  createBy: {title: '提交人',order: 0,view: 'text', type: 'string',},
  createTime: {title: '提交时间',order: 1,view: 'datetime', type: 'string',},
  sais: {title: '赛事',order: 2,view: 'list', type: 'string',dictTable: "cdba2_sais", dictCode: 'id', dictText: 'mingc',},
  saiq: {title: '赛区',order: 3,view: 'cat_tree', type: 'string',pcode: 'C05',},
  zuopbt: {title: '作品标题',order: 4,view: 'text', type: 'string',},
  zuopId: {title: '作品id',order: 5,view: 'text', type: 'string',},
  saisjc: {title: '赛事进程',order: 6,view: 'list', type: 'string',dictTable: "cdba2_saisjc", dictCode: 'id', dictText: 'jincmc',},
  pingszt: {title: '评审状态',order: 7,view: 'list', type: 'string',dictCode: 'pingszt',},
  zilshjg: {title: '资料审核结果',order: 8,view: 'list', type: 'string',dictCode: 'zilsh',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}